.TH putw 3 "" "" ""
.SH SYNOPSIS
putw \- write a word (int)
.SH ANSI_SYNOPSIS
#include <stdio.h>
.br
int putw(int 
.IR w ,
FILE *
.IR fp );
.br
.SH TRAD_SYNOPSIS
#include <stdio.h>
.br
int putw(<w>, 
.IR fp )
.br
int <w>;
.br
FILE *
.IR fp ;
.br
.SH DESCRIPTION
.BR putw 
is a function, defined in 
.BR stdio.h .
You can use 
.BR putw 
to write a word to the file or stream identified by 
.IR fp .
As a side
effect, 
.BR putw 
advances the file's current position indicator.

RETURNS Zero on success, 
.BR EOF 
on failure.
.SH PORTABILITY
.BR putw 
is a remnant of K&R C, it is not part of any ISO C Standard.
.BR fwrite 
should be used instead. In fact, this implementation of
.BR putw 
is based upon 
.BR fwrite .

Supporting OS subroutines required: 
.BR fwrite .
*/

#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */

#include <stdio.h>

int
putw (w, fp)
int w;
register FILE *fp;
{
if (fwrite((const char*)&w, sizeof(w), 1, fp) != 1)
return EOF;
return 0;
}
.SH SOURCE
src/newlib/libc/stdio/putw.c
